<include file="Index/header"/>
<script language="javascript" type="text/javascript" src="__PUBLIC__/My97DatePicker/WdatePicker.js"></script>

    
  <include file="Index/left"/>
    
    
    <div class="content">
        
        <div class="header">
            
            <h1 class="page-title">录入教室资料</h1>
        </div>
        
                <ul class="breadcrumb">
            <li><a href="{:U('Index/Index')}">首页</a> <span class="divider">/</span></li>
            <li><a href="#">类别管理</a> <span class="divider">/</span></li>
            <li class="active">教室资料管理</li>
        </ul>

        <div class="container-fluid">
            <div class="row-fluid">
                    

<div class="well" id='well2'>
    <ul class="nav nav-tabs">
      <li class="active"><a href="#home" data-toggle="tab">添加教室信息</a></li>

    </ul>
    <div id="myTabContent" class="tab-content" style="margin-left:80px;width:400px">
      <div class="tab-pane active in" id="home">
          <form id="tab" >
        教室名称：
        <input type="text" value="" id="classname" name="classname" class="input-xlarge">
		<br><br>
        <label>备&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;注：
        <input type="text" value="" id="crc" name="crc" class="input-xlarge">
       <br>
        <br />
        <div style="margin-left:180px"><button  type="button" class="btn btn-primary" onclick="tj()">确&nbsp;&nbsp;&nbsp;&nbsp;定</button>&nbsp;&nbsp;&nbsp;&nbsp;
		<button type="button" class="btn btn-primary"  onclick="history.go(-1)">取&nbsp;&nbsp;&nbsp;&nbsp;消</button></div>
    </form>
      </div>
  
      </div>
  </div>

</div>



                    
                    <footer>
                        <hr>

                    
                    </footer>
                    
            </div>
        </div>
    </div>
   <script type="text/javascript">  
function tj(){
  var classname=$('#classname').val();
  var remark=$('#crc').val().length;
if(remark>100){
    
   alert('备注超过最大字数限制'); 
   return
}
   $.ajax({
                type: "POST",
                url: "__CONTROLLER__/Addclasses",
           
                cache: false,
                data: $('#tab').serialize(),
         
                    success: function(data) {
                switch(data){
                           
                case '0':
                alert('教室添加成功');
                window.location.replace("__CONTROLLER__/Classesadmin") 
                break;
                case '1': 
                 alert('教室添加失败');
           
                break;
        case '3':
                alert('教室名称已存在');
                break;
            default:
                alert(data);
        }
              
                       }
                    
        
        
        
        })

    
}
</script>

    <script src="__PUBLIC__/lib/bootstrap/js/bootstrap.js"></script>
    <script type="text/javascript">
        $("[rel=tooltip]").tooltip();
        $(function() {
            $('.demo-cancel-click').click(function(){return false;});
        });
    </script>
    
  </body>
</html>


